//
//  CoreLocationExampleViewController.m
//  CoreLocationExample
//

#import "CoreLocationExampleViewController.h"

@implementation CoreLocationExampleViewController

- (void)viewDidLoad {
    [super viewDidLoad];

	lm = [[CLLocationManager alloc] init];
	lm.delegate = self;
	[lm startUpdatingLocation];
}

- (void)locationManager:(CLLocationManager *)manager
	didUpdateToLocation:(CLLocation *)newLoc
		   fromLocation:(CLLocation *)oldLoc {
	NSLog(@"location found: %@", newLoc.description);
	[lm stopUpdatingLocation];
}

- (void)locationManager:(CLLocationManager *)manager
	   didFailWithError:(NSError *)error {
	NSLog(@"location failed with error: %@", error);
	[lm stopUpdatingLocation];
}

- (void)dealloc {
	[lm release];
    [super dealloc];
}

@end
